<template>
  <div>
      <span @click="changeStore">我是home.vue</span>
      <button @click="goToAbout">跳转about</button>
      <img src="../assets/center.png" alt="">
  </div>
</template>

<script>
export default {
    data(){
        return {
          name: ''
        }
    },
    created() {
      this.name = this.$store.state.name;
    },
    methods: {
      changeStore() {
        this.$store.state.name = '改变了文字';
      },
      goToAbout() {
        this.$router.push('./about')
      }
    }
}
</script>

<style>

</style>
